package pw.goyd.game.logic;

import pw.goyd.game.model.LuckyAward;
import pw.goyd.protocol.core.Serializer;

/**
 * 抽奖响应
 * Created by StanWind on 16/11/5.
 */
public class LuckyAwardResponse extends Serializer {
    private int state;                  //  是否抽奖成功 0正常  1没次数
    private LuckyAward luckyAward;

    public int getState() {
        return state;
    }

    public void setState(int state) {
        this.state = state;
    }

    public LuckyAward getLuckyAward() {
        return luckyAward;
    }

    public void setLuckyAward(LuckyAward luckyAward) {
        this.luckyAward = luckyAward;
    }

    @Override
    protected void read() {

    }

    @Override
    protected void write() {
        writeByte((byte) state);                                //  状态标识
        writeByte((byte) luckyAward.getLuckyType().ordinal());  //  物品类型
        writeInt(luckyAward.getValue());                        //  物品数量

    }
}
